<head>
  <style> body { margin: 0; } </style>

  <script type="importmap">{ "imports": {
    "react": "https://esm.sh/react",
    "react-dom": "https://esm.sh/react-dom/client"
  }}</script>
  <script type="module">
    import * as React from 'react';
    window.React = React;
  </script>

  <script src="//unpkg.com/react-force-graph" defer></script>
  <!--<script src="../../dist/react-force-graph.js" defer></script>-->
</head>

<body>
  <div id="graph"></div>

  <script src="//unpkg.com/@babel/standalone"></script>
  <script type="text/jsx" data-type="module">
    import { createRoot } from 'react-dom';
    import { genRandomTree } from '../datasets/random-data.js';

    const comps = [ForceGraph.ForceGraph2D, ForceGraph.ForceGraph3D, ForceGraph.ForceGraphVR];
    const compWidth = window.innerWidth / comps.length;

    createRoot(document.getElementById('graph')).render(
      <div style={{ display: 'flex' }}>
        {comps.map(Comp =>
          <Comp
            width={compWidth}
            graphData={genRandomTree()}
          />
        )}
      </div>
    );
  </script>
</body>